/*动态改变根元素字体大小*/
console.log("页面进入时间",new Date().getTime())
function recalc() {
	var clientWidth = document.documentElement.clientWidth;
	if(!clientWidth) return;
	//设置最大值为420
	clientWidth = clientWidth > 420 ? 420 : clientWidth;
	//pc端要减掉20，滚动条宽度
	clientWidth = IsPC() ? clientWidth - 20 : clientWidth;
	var rootSize = 40 * (clientWidth / 750);
	var rootSize = Math.round(rootSize);
	document.documentElement.style.cssText += "font-size:" + (rootSize) + 'px!important';//设置！important
}
function initRecalc() {
	recalc();
	var resizeEvt = 'osrientationchange' in window ? 'orientationchange' : 'resize';
	if(!document.addEventListener) return;
	window.addEventListener(resizeEvt, recalc, false);
	document.addEventListener('DOMContentLoaded', recalc, false);
}

initRecalc();




//是否为pc端   
function IsPC() {
	var userAgentInfo = navigator.userAgent;
	var Agents = ["Android", "iPhone",
		"SymbianOS", "Windows Phone",
		"iPad", "iPod"
	];
	var flag = true;
	for(var v = 0; v < Agents.length; v++) {
		if(userAgentInfo.indexOf(Agents[v]) > 0) {
			flag = false;
			break;
		}
	}
	return flag;
}
